import Vue from 'vue'
import VueRouter from 'vue-router'
import layout from '@/views/layout/index.vue'
import home from '../components/Home/index'
import video from '../components/video/index'
import question from '../components/question/index'
import setting from '../components/setting/index'
import Login from '@/views/login/index.vue'
import search from '@/views/search/index'
Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/',
    name: 'layout',
    component: layout,
    children: [
      {
        path: '',
        component: home
      },
      {
        path: '/video',
        component: video
      },
      {
        path: '/question',
        component: question
      },
      {
        path: '/setting',
        component: setting
      },
      {
        path: '/search',
        component: search
      }
    ]
  }
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
